/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.user
 * UserService.java
 * 创建人:hufanglei
 * 时间：2016年11月24日-上午1:01:27
 *
 */
package com.tz.service.adminUser.impl;

import com.tz.bean.AdminUser;
import com.tz.bean.Permission;
import com.tz.bean.TzParams;
import com.tz.dao.adminUser.IAdminUserMapper;
import com.tz.service.adminUser.IAdminUserService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 
 * UserService
 * 创建人:hufanglei
 * 时间：2016年11月24日-上午1:01:27
 * @version 1.0.0
 * 
 */
@Service
public class AdminUserService implements IAdminUserService {


	@Autowired
	private IAdminUserMapper  adminUserMapper;

	
	@Override
	public AdminUser getLogin(TzParams params) {
		return adminUserMapper.getLogin(params);
	}

	@Override
	public int saveBatch(List<AdminUser> adminUsers) {
		return adminUserMapper.saveBatch(adminUsers);
	}

	@Override
	public int batchUpdate(List<AdminUser> adminUsers) {
		return adminUserMapper.batchUpdate(adminUsers);
	}

	@Override
	public List<HashMap<String, Object>> findAdminUsers(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("a.create_time desc");
		return adminUserMapper.findAdminUsers(params);
	}

	@Override
	public int count(TzParams params){
		return adminUserMapper.count(params);
	}

	@Override
	public AdminUser get(Integer id) {
		return adminUserMapper.get(id);
	}

	@Override
	public int save(AdminUser adminuser) {
		return adminUserMapper.save(adminuser);
	}

	@Override
	public int update(AdminUser adminuser) {
		return adminUserMapper.update(adminuser);
	}

	@Override
	public int delete(TzParams params) {
		return adminUserMapper.delete(params);
	}

	@Override
	public List<Permission> getPermissionByUserId(Integer id) {
		return adminUserMapper.getPermissionByUserId(id);
	}

	@Override
	public List<Permission> getParentPermissionByUserId(Integer id) {
		return adminUserMapper.getParentPermissionByUserId(id);
	}

	@Override
	public List<Permission> getNextPermissionByUserId(HashMap map) {
		return adminUserMapper.getNextPermissionByUserId(map);
	}
}
